<?php
class Conexao {
    private $local;
    private $user;
    private $senha;    
    private $nome_db;
    private $con;
    
    public function __construct() {
        $this->local = 'localhost';
        $this->user = 'root';
        $this->senha = '';
        $this->nome_db = 'atleta';
    }
    
    public function abrir() {
        try{
            $this->con = mysql_connect($this->local, $this->user, $this->senha);
            mysql_select_db($this->nome_db, $this->con);                        
        }catch(Exception $e){
            echo ("falha na conexao");
        }
    }
    
    public function fechar() {        
        $closed = mysql_close($this->con);
        $closed = NULL;
    }
    
    public function getCon() {
        return$this->con;
    }
}
?>
